﻿using ConfExpert.Forms.Base;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraEditors.Repository;
using Extensions;
using System;

namespace ConfExpert.Forms.Sistem
{
    public partial class RollStats : XForm
    {
        public RollStats()
        {
            InitializeComponent();
        }

        private void RollStats_Load(object sender, EventArgs e)
        {
            
            
           ((RepositoryItemComboBox)comboBoxEdit1.Edit).SelectedIndexChanged += new EventHandler(comboBoxEdit1_SelectedIndexChanged);
           ((RepositoryItemComboBox)comboBoxEdit1.Edit).TextEditStyle = TextEditStyles.DisableTextEditor;
            gridView1.Init("GetRollStat", this.sel);
            gridView1.AddSummary("Qty");
        }

        void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
        {
            gridView1.VeriyiGuncelle(true, "GetRollStat", this.sel);
            gridView1.BestFitColumns();
        }

        private int _sel;
        public int sel
        {
            get
            {
                
                switch (comboBoxEdit1.EditValue.ToString())
                {
                    case "RFID tag'i eksik": sel = 1; break;
                    case "Rafa yerleştirilmemiş": sel = 2; break;
                    case "Qty'si girilmemiş": sel = 3; break;
                    case "Ayrılmadığı için görülmeyen": sel = 4; break;
                        
                }
                return _sel;

            }
            set
            {
                _sel = value;
            }
        }
    }
}